<?php
/**
 * #Celebrate Shieh
 *             ,%%%%%%%%,
 *           ,%%/\%%%%/\%%
 *          ,%%%\c "" J/%%%
 * %.       %%%%/ o  o \%%%
 * `%%.     %%%%    _  |%%%
 *  `%%     `%%%%(__Y__)%%'
 *  //       ;%%%%`\-/%%%'
 * ((       /  `%%%%%%%'
 *  \\    .'          |
 *   \\  /       \  | |
 *    \\/         ) | |
 *     \         /_ | |__
 *     (___________))))))) 攻城湿
 *
 *        _       _
 * __   _(_)_   _(_) __ _ _ __
 * \ \ / / \ \ / / |/ _` |'_ \
 *  \ V /| |\ V /| | (_| | | | |
 *   \_/ |_| \_/ |_|\__,_|_| |_|
 */

namespace App\Modules\Blog\Http\Controllers;


use Illuminate\Http\Request;


class MaterialController extends Controller
{
    /**
     * 素材
     *
     * @param Request $request
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function index( Request $request )
    {
        return $this->getMaterial()->MaterialIndexService($request);
    }

    /**
     * 新增
     *
     * @param Request $request
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function create( Request $request )
    {
        return $this->getMaterial()->MaterialCreateService($request);
    }

    /**
     * 删除
     *
     * @param $id
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function destroy( $id )
    {
        return $this->getMaterial()->MaterialDestroyService($id);
    }

    /**
     * 批量删除
     *
     * @param Request $request
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function delete( Request $request )
    {
        return $this->getMaterial()->MaterialDestroyService($request->input('id', []));
    }
}
